// --------------------------------------------------------------------------------------------------------------------
// <copyright file="IndexHelper.cs" company="Concept Architecture">
//   (c) 2010 Muhammad Umer Farooq
// </copyright>
// <summary>
//   Defines the <seealso cref="IndexHelper" /> type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Hisaab.Client.Common.Helpers
{
    using System.Windows;
    using System.Windows.Controls;

    /// <summary>
    /// Defines the <seealso cref="IndexHelper"/> type.
    /// </summary>
    public static class IndexHelper
    {
        /// <summary>
        /// Password dependency property
        /// </summary>
        public static readonly DependencyProperty IndexProperty =
            DependencyProperty.RegisterAttached("Index", typeof(int), typeof(Control));

        /// <summary>
        /// Gets the password.
        /// </summary>
        /// <param name="dp">The dependency property</param>
        /// <returns>Password value binded</returns>
        public static int GetIndex(DependencyObject dp)
        {
            return (int)dp.GetValue(IndexProperty);
        }

        /// <summary>
        /// Sets the password.
        /// </summary>
        /// <param name="dp">The dependency property</param>
        /// <param name="value">The value.</param>
        public static void SetIndex(DependencyObject dp, int value)
        {
            dp.SetValue(IndexProperty, value);
        }
    }
}